package com.zlfund.cat.demo;

import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.ViewGroup;

/**
 * Created by chenj
 * Created on 2017/7/19
 */

public class SinGroup extends ViewGroup {

    private Outline mOutline;

    public SinGroup(Context context) {
        this(context,null);
    }

    public SinGroup(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public SinGroup(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mOutline = new Outline();
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Drawable background = getBackground();

        background.getOutline(mOutline);



    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(canvas);
    }
}
